package com.ykdl.member.kid.beans;

import java.io.Serializable;
import java.text.DecimalFormat;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ykdl.member.kid.adapters.DebateBean;

import net.wxxr.http.interfaces.IJsonParser;

public class Product_infoBean implements Serializable, IJsonParser{

	/**"product_info": {
                "status": 0,
                "product_id": 1,
                "store_id": 100100130,
                "is_debate": false,
                "price": 10,
                "created_time": 1430363762,
                "list_pic": {
                    "url": "http://imgs.ykdllmyr.com/fxs/2015/3/23/qqZ42isga6XF4HYWQJYKe3.jpeg",
                    "width": 750,
                    "file_id": 100386,
                    "height": 588
                },
                "name": "商品1"
            },
	 * 
	 */
	private static final long serialVersionUID = 2101085147205562572L;
	private int status;
	private int product_id;
	private int store_id;
	private boolean is_debate;
	private String price;
	private String created_time;
	private FileBean list_pic;
	private String name;
	private DebateBean debate;
	public DebateBean getDebate() {
		return debate;
	}
	public int getStatus() {
		return status;
	}
	public int getProduct_id() {
		return product_id;
	}
	public int getStore_id() {
		return store_id;
	}
	public boolean isIs_debate() {
		return is_debate;
	}
	public String getPrice() {
		double float_price =Double.parseDouble(price);
		DecimalFormat decimalFormat=new DecimalFormat("##0.00");//构造方法的字符格式这里如果小数不足2位,会以0补足.
		String p=decimalFormat.format(float_price);//format 返回的是字符串
		return p;
	}
	public String getCreated_time() {
		return created_time;
	}
	public FileBean getList_pic() {
		return list_pic;
	}
	public String getName() {
		return name;
	}
	@Override
	public IJsonParser parse(String json) throws Exception {
		// TODO Auto-generated method stub
		Gson   gson = null;
		if(null != json){
			GsonBuilder b = new GsonBuilder();
			gson  = b.create();
			return gson.fromJson(json, Product_infoBean.class);
		}
		return null;
	}

}
